package com.ruoyi.heytalk.controller.system;

import com.ruoyi.common.constant.heytalk.CommonConstants;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.heytalk.dto.CreateGroupDTO;
import com.ruoyi.heytalk.service.IImGroupService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 群组请求控制器
 * @author zhusy
 * @since 2021/12/22
 */
@Api(value = "群组请求控制层", tags = {"群组请求控制层"})
@RequiredArgsConstructor(onConstructor_ = @Autowired)
@RestController
@RequestMapping(CommonConstants.HEY_TALK)
public class GroupController extends BaseController {

    private final IImGroupService groupService;

    @ApiOperation("创建群聊组")
    @PostMapping("/group/create")
    public AjaxResult<Void> createGroup(@Validated @RequestBody CreateGroupDTO createGroupDTO) {
        System.out.println("ids===" + createGroupDTO.toString());
        return groupService.createGroup(createGroupDTO);
    }

}
